package com.sl.leetcode;

import java.lang.reflect.Method;

/**
 * Created by lisulong on 2019/5/28.
 */
public class Solution1024 {
    public void method1(String s) {

    }

    public static void main(String[] args) throws Exception {
        Class<Solution1024> clz = Solution1024.class;
        Object obj = clz.newInstance();
        Method executeMethod;
        for (int i = 1; i <= 1; i++) {
            long startTime = System.nanoTime();
            executeMethod = clz.getMethod("method" + i, String.class);
            System.out.println(executeMethod.invoke(obj, "{([]])}"));//数组做为参数的，需要使用new Object[]{}包一层
            System.out.println("====耗时：" + (System.nanoTime() - startTime));
        }
    }
}
